import {App} from "vue"
import {createRouter,createWebHistory} from "vue-router";
import  routes from "./router"  //导入router.ts

import  autoload from "./autoload/index";
import guard from "./guard";


//创建router实例
const  router =createRouter({
    history:createWebHistory(),
    routes:[...routes]
})

export async function setupRouter(app:App){//App接口
    
  
  //添加自定义路由
  autoload(router)
  //路由守卫
  guard(router)
  app.use(router)
 
 
}

export default  router